<?php
	/**
	 * This is a MetaControl class, providing a QForm or QPanel access to event handlers
	 * and QControls to perform the Create, Edit, and Delete functionality
	 * of the User class.  This code-generated class
	 * contains all the basic elements to help a QPanel or QForm display an HTML form that can
	 * manipulate a single User object.
	 *
	 * To take advantage of some (or all) of these control objects, you
	 * must create a new QForm or QPanel which instantiates a UserMetaControl
	 * class.
	 *
	 * Any and all changes to this file will be overwritten with any subsequent
	 * code re-generation.
	 * 
	 * @package My Application
	 * @subpackage MetaControls
	 * property-read User $User the actual User data class being edited
	 * property QLabel $IdControl
	 * property-read QLabel $IdLabel
	 * property QTextBox $NickControl
	 * property-read QLabel $NickLabel
	 * property QTextBox $PasswordControl
	 * property-read QLabel $PasswordLabel
	 * property QTextBox $EmailControl
	 * property-read QLabel $EmailLabel
	 * property QTextBox $StatusControl
	 * property-read QLabel $StatusLabel
	 * property QDateTimePicker $CreatedAtControl
	 * property-read QLabel $CreatedAtLabel
	 * property QTextBox $ActivationKeyControl
	 * property-read QLabel $ActivationKeyLabel
	 * property QDateTimePicker $ActivatedAtControl
	 * property-read QLabel $ActivatedAtLabel
	 * property QDateTimePicker $LastseenAtControl
	 * property-read QLabel $LastseenAtLabel
	 * property QTextBox $RealnameControl
	 * property-read QLabel $RealnameLabel
	 * property QTextBox $AddressControl
	 * property-read QLabel $AddressLabel
	 * property QTextBox $StateControl
	 * property-read QLabel $StateLabel
	 * property QTextBox $ZipControl
	 * property-read QLabel $ZipLabel
	 * property QIntegerTextBox $FbinCountControl
	 * property-read QLabel $FbinCountLabel
	 * property QIntegerTextBox $FbinTotalControl
	 * property-read QLabel $FbinTotalLabel
	 * property QIntegerTextBox $FboutCountControl
	 * property-read QLabel $FboutCountLabel
	 * property QIntegerTextBox $FboutTotalControl
	 * property-read QLabel $FboutTotalLabel
	 * property-read string $TitleVerb a verb indicating whether or not this is being edited or created
	 * property-read boolean $EditMode a boolean indicating whether or not this is being edited or created
	 */

	class UserMetaControlGen extends QBaseClass {
		// General Variables
		protected $objUser;
		protected $objParentObject;
		protected $strTitleVerb;
		protected $blnEditMode;

		// Controls that allow the editing of User's individual data fields
		protected $lblId;
		protected $txtNick;
		protected $txtPassword;
		protected $txtEmail;
		protected $txtStatus;
		protected $calCreatedAt;
		protected $txtActivationKey;
		protected $calActivatedAt;
		protected $calLastseenAt;
		protected $txtRealname;
		protected $txtAddress;
		protected $txtState;
		protected $txtZip;
		protected $txtFbinCount;
		protected $txtFbinTotal;
		protected $txtFboutCount;
		protected $txtFboutTotal;

		// Controls that allow the viewing of User's individual data fields
		protected $lblNick;
		protected $lblPassword;
		protected $lblEmail;
		protected $lblStatus;
		protected $lblCreatedAt;
		protected $lblActivationKey;
		protected $lblActivatedAt;
		protected $lblLastseenAt;
		protected $lblRealname;
		protected $lblAddress;
		protected $lblState;
		protected $lblZip;
		protected $lblFbinCount;
		protected $lblFbinTotal;
		protected $lblFboutCount;
		protected $lblFboutTotal;

		// QListBox Controls (if applicable) to edit Unique ReverseReferences and ManyToMany References

		// QLabel Controls (if applicable) to view Unique ReverseReferences and ManyToMany References


		/**
		 * Main constructor.  Constructor OR static create methods are designed to be called in either
		 * a parent QPanel or the main QForm when wanting to create a
		 * UserMetaControl to edit a single User object within the
		 * QPanel or QForm.
		 *
		 * This constructor takes in a single User object, while any of the static
		 * create methods below can be used to construct based off of individual PK ID(s).
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this UserMetaControl
		 * @param User $objUser new or existing User object
		 */
		 public function __construct($objParentObject, User $objUser) {
			// Setup Parent Object (e.g. QForm or QPanel which will be using this UserMetaControl)
			$this->objParentObject = $objParentObject;

			// Setup linked User object
			$this->objUser = $objUser;

			// Figure out if we're Editing or Creating New
			if ($this->objUser->__Restored) {
				$this->strTitleVerb = QApplication::Translate('Edit');
				$this->blnEditMode = true;
			} else {
				$this->strTitleVerb = QApplication::Translate('Create');
				$this->blnEditMode = false;
			}
		 }

		/**
		 * Static Helper Method to Create using PK arguments
		 * You must pass in the PK arguments on an object to load, or leave it blank to create a new one.
		 * If you want to load via QueryString or PathInfo, use the CreateFromQueryString or CreateFromPathInfo
		 * static helper methods.  Finally, specify a CreateType to define whether or not we are only allowed to 
		 * edit, or if we are also allowed to create a new one, etc.
		 * 
		 * @param mixed $objParentObject QForm or QPanel which will be using this UserMetaControl
		 * @param integer $intId primary key value
		 * @param QMetaControlCreateType $intCreateType rules governing User object creation - defaults to CreateOrEdit
 		 * @return UserMetaControl
		 */
		public static function Create($objParentObject, $intId = null, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			// Attempt to Load from PK Arguments
			if (strlen($intId)) {
				$objUser = User::Load($intId);

				// User was found -- return it!
				if ($objUser)
					return new UserMetaControl($objParentObject, $objUser);

				// If CreateOnRecordNotFound not specified, throw an exception
				else if ($intCreateType != QMetaControlCreateType::CreateOnRecordNotFound)
					throw new QCallerException('Could not find a User object with PK arguments: ' . $intId);

			// If EditOnly is specified, throw an exception
			} else if ($intCreateType == QMetaControlCreateType::EditOnly)
				throw new QCallerException('No PK arguments specified');

			// If we are here, then we need to create a new record
			return new UserMetaControl($objParentObject, new User());
		}

		/**
		 * Static Helper Method to Create using PathInfo arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this UserMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing User object creation - defaults to CreateOrEdit
		 * @return UserMetaControl
		 */
		public static function CreateFromPathInfo($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::PathInfo(0);
			return UserMetaControl::Create($objParentObject, $intId, $intCreateType);
		}

		/**
		 * Static Helper Method to Create using QueryString arguments
		 *
		 * @param mixed $objParentObject QForm or QPanel which will be using this UserMetaControl
		 * @param QMetaControlCreateType $intCreateType rules governing User object creation - defaults to CreateOrEdit
		 * @return UserMetaControl
		 */
		public static function CreateFromQueryString($objParentObject, $intCreateType = QMetaControlCreateType::CreateOrEdit) {
			$intId = QApplication::QueryString('intId');
			return UserMetaControl::Create($objParentObject, $intId, $intCreateType);
		}



		///////////////////////////////////////////////
		// PUBLIC CREATE and REFRESH METHODS
		///////////////////////////////////////////////

		/**
		 * Create and setup QLabel lblId
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblId_Create($strControlId = null) {
			$this->lblId = new QLabel($this->objParentObject, $strControlId);
			$this->lblId->Name = QApplication::Translate('Id');
			if ($this->blnEditMode)
				$this->lblId->Text = $this->objUser->Id;
			else
				$this->lblId->Text = 'N/A';
			return $this->lblId;
		}

		/**
		 * Create and setup QTextBox txtNick
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtNick_Create($strControlId = null) {
			$this->txtNick = new QTextBox($this->objParentObject, $strControlId);
			$this->txtNick->Name = QApplication::Translate('Nick');
			$this->txtNick->Text = $this->objUser->Nick;
			$this->txtNick->Required = true;
			$this->txtNick->MaxLength = User::NickMaxLength;
			return $this->txtNick;
		}

		/**
		 * Create and setup QLabel lblNick
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblNick_Create($strControlId = null) {
			$this->lblNick = new QLabel($this->objParentObject, $strControlId);
			$this->lblNick->Name = QApplication::Translate('Nick');
			$this->lblNick->Text = $this->objUser->Nick;
			$this->lblNick->Required = true;
			return $this->lblNick;
		}

		/**
		 * Create and setup QTextBox txtPassword
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtPassword_Create($strControlId = null) {
			$this->txtPassword = new QTextBox($this->objParentObject, $strControlId);
			$this->txtPassword->Name = QApplication::Translate('Password');
			$this->txtPassword->Text = $this->objUser->Password;
			$this->txtPassword->Required = true;
			$this->txtPassword->MaxLength = User::PasswordMaxLength;
			return $this->txtPassword;
		}

		/**
		 * Create and setup QLabel lblPassword
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblPassword_Create($strControlId = null) {
			$this->lblPassword = new QLabel($this->objParentObject, $strControlId);
			$this->lblPassword->Name = QApplication::Translate('Password');
			$this->lblPassword->Text = $this->objUser->Password;
			$this->lblPassword->Required = true;
			return $this->lblPassword;
		}

		/**
		 * Create and setup QTextBox txtEmail
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtEmail_Create($strControlId = null) {
			$this->txtEmail = new QTextBox($this->objParentObject, $strControlId);
			$this->txtEmail->Name = QApplication::Translate('Email');
			$this->txtEmail->Text = $this->objUser->Email;
			$this->txtEmail->Required = true;
			$this->txtEmail->MaxLength = User::EmailMaxLength;
			return $this->txtEmail;
		}

		/**
		 * Create and setup QLabel lblEmail
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblEmail_Create($strControlId = null) {
			$this->lblEmail = new QLabel($this->objParentObject, $strControlId);
			$this->lblEmail->Name = QApplication::Translate('Email');
			$this->lblEmail->Text = $this->objUser->Email;
			$this->lblEmail->Required = true;
			return $this->lblEmail;
		}

		/**
		 * Create and setup QTextBox txtStatus
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtStatus_Create($strControlId = null) {
			$this->txtStatus = new QTextBox($this->objParentObject, $strControlId);
			$this->txtStatus->Name = QApplication::Translate('Status');
			$this->txtStatus->Text = $this->objUser->Status;
			$this->txtStatus->Required = true;
			return $this->txtStatus;
		}

		/**
		 * Create and setup QLabel lblStatus
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblStatus_Create($strControlId = null) {
			$this->lblStatus = new QLabel($this->objParentObject, $strControlId);
			$this->lblStatus->Name = QApplication::Translate('Status');
			$this->lblStatus->Text = $this->objUser->Status;
			$this->lblStatus->Required = true;
			return $this->lblStatus;
		}

		/**
		 * Create and setup QDateTimePicker calCreatedAt
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calCreatedAt_Create($strControlId = null) {
			$this->calCreatedAt = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calCreatedAt->Name = QApplication::Translate('Created At');
			$this->calCreatedAt->DateTime = $this->objUser->CreatedAt;
			$this->calCreatedAt->DateTimePickerType = QDateTimePickerType::DateTime;
			$this->calCreatedAt->Required = true;
			return $this->calCreatedAt;
		}

		/**
		 * Create and setup QLabel lblCreatedAt
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblCreatedAt_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblCreatedAt = new QLabel($this->objParentObject, $strControlId);
			$this->lblCreatedAt->Name = QApplication::Translate('Created At');
			$this->strCreatedAtDateTimeFormat = $strDateTimeFormat;
			$this->lblCreatedAt->Text = sprintf($this->objUser->CreatedAt) ? $this->objUser->CreatedAt->__toString($this->strCreatedAtDateTimeFormat) : null;
			$this->lblCreatedAt->Required = true;
			return $this->lblCreatedAt;
		}

		protected $strCreatedAtDateTimeFormat;


		/**
		 * Create and setup QTextBox txtActivationKey
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtActivationKey_Create($strControlId = null) {
			$this->txtActivationKey = new QTextBox($this->objParentObject, $strControlId);
			$this->txtActivationKey->Name = QApplication::Translate('Activation Key');
			$this->txtActivationKey->Text = $this->objUser->ActivationKey;
			$this->txtActivationKey->Required = true;
			$this->txtActivationKey->MaxLength = User::ActivationKeyMaxLength;
			return $this->txtActivationKey;
		}

		/**
		 * Create and setup QLabel lblActivationKey
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblActivationKey_Create($strControlId = null) {
			$this->lblActivationKey = new QLabel($this->objParentObject, $strControlId);
			$this->lblActivationKey->Name = QApplication::Translate('Activation Key');
			$this->lblActivationKey->Text = $this->objUser->ActivationKey;
			$this->lblActivationKey->Required = true;
			return $this->lblActivationKey;
		}

		/**
		 * Create and setup QDateTimePicker calActivatedAt
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calActivatedAt_Create($strControlId = null) {
			$this->calActivatedAt = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calActivatedAt->Name = QApplication::Translate('Activated At');
			$this->calActivatedAt->DateTime = $this->objUser->ActivatedAt;
			$this->calActivatedAt->DateTimePickerType = QDateTimePickerType::DateTime;
			$this->calActivatedAt->Required = true;
			return $this->calActivatedAt;
		}

		/**
		 * Create and setup QLabel lblActivatedAt
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblActivatedAt_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblActivatedAt = new QLabel($this->objParentObject, $strControlId);
			$this->lblActivatedAt->Name = QApplication::Translate('Activated At');
			$this->strActivatedAtDateTimeFormat = $strDateTimeFormat;
			$this->lblActivatedAt->Text = sprintf($this->objUser->ActivatedAt) ? $this->objUser->ActivatedAt->__toString($this->strActivatedAtDateTimeFormat) : null;
			$this->lblActivatedAt->Required = true;
			return $this->lblActivatedAt;
		}

		protected $strActivatedAtDateTimeFormat;


		/**
		 * Create and setup QDateTimePicker calLastseenAt
		 * @param string $strControlId optional ControlId to use
		 * @return QDateTimePicker
		 */
		public function calLastseenAt_Create($strControlId = null) {
			$this->calLastseenAt = new QDateTimePicker($this->objParentObject, $strControlId);
			$this->calLastseenAt->Name = QApplication::Translate('Lastseen At');
			$this->calLastseenAt->DateTime = $this->objUser->LastseenAt;
			$this->calLastseenAt->DateTimePickerType = QDateTimePickerType::DateTime;
			$this->calLastseenAt->Required = true;
			return $this->calLastseenAt;
		}

		/**
		 * Create and setup QLabel lblLastseenAt
		 * @param string $strControlId optional ControlId to use
		 * @param string $strDateTimeFormat optional DateTimeFormat to use
		 * @return QLabel
		 */
		public function lblLastseenAt_Create($strControlId = null, $strDateTimeFormat = null) {
			$this->lblLastseenAt = new QLabel($this->objParentObject, $strControlId);
			$this->lblLastseenAt->Name = QApplication::Translate('Lastseen At');
			$this->strLastseenAtDateTimeFormat = $strDateTimeFormat;
			$this->lblLastseenAt->Text = sprintf($this->objUser->LastseenAt) ? $this->objUser->LastseenAt->__toString($this->strLastseenAtDateTimeFormat) : null;
			$this->lblLastseenAt->Required = true;
			return $this->lblLastseenAt;
		}

		protected $strLastseenAtDateTimeFormat;


		/**
		 * Create and setup QTextBox txtRealname
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtRealname_Create($strControlId = null) {
			$this->txtRealname = new QTextBox($this->objParentObject, $strControlId);
			$this->txtRealname->Name = QApplication::Translate('Realname');
			$this->txtRealname->Text = $this->objUser->Realname;
			$this->txtRealname->Required = true;
			$this->txtRealname->MaxLength = User::RealnameMaxLength;
			return $this->txtRealname;
		}

		/**
		 * Create and setup QLabel lblRealname
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblRealname_Create($strControlId = null) {
			$this->lblRealname = new QLabel($this->objParentObject, $strControlId);
			$this->lblRealname->Name = QApplication::Translate('Realname');
			$this->lblRealname->Text = $this->objUser->Realname;
			$this->lblRealname->Required = true;
			return $this->lblRealname;
		}

		/**
		 * Create and setup QTextBox txtAddress
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtAddress_Create($strControlId = null) {
			$this->txtAddress = new QTextBox($this->objParentObject, $strControlId);
			$this->txtAddress->Name = QApplication::Translate('Address');
			$this->txtAddress->Text = $this->objUser->Address;
			$this->txtAddress->Required = true;
			$this->txtAddress->MaxLength = User::AddressMaxLength;
			return $this->txtAddress;
		}

		/**
		 * Create and setup QLabel lblAddress
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblAddress_Create($strControlId = null) {
			$this->lblAddress = new QLabel($this->objParentObject, $strControlId);
			$this->lblAddress->Name = QApplication::Translate('Address');
			$this->lblAddress->Text = $this->objUser->Address;
			$this->lblAddress->Required = true;
			return $this->lblAddress;
		}

		/**
		 * Create and setup QTextBox txtState
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtState_Create($strControlId = null) {
			$this->txtState = new QTextBox($this->objParentObject, $strControlId);
			$this->txtState->Name = QApplication::Translate('State');
			$this->txtState->Text = $this->objUser->State;
			$this->txtState->Required = true;
			$this->txtState->MaxLength = User::StateMaxLength;
			return $this->txtState;
		}

		/**
		 * Create and setup QLabel lblState
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblState_Create($strControlId = null) {
			$this->lblState = new QLabel($this->objParentObject, $strControlId);
			$this->lblState->Name = QApplication::Translate('State');
			$this->lblState->Text = $this->objUser->State;
			$this->lblState->Required = true;
			return $this->lblState;
		}

		/**
		 * Create and setup QTextBox txtZip
		 * @param string $strControlId optional ControlId to use
		 * @return QTextBox
		 */
		public function txtZip_Create($strControlId = null) {
			$this->txtZip = new QTextBox($this->objParentObject, $strControlId);
			$this->txtZip->Name = QApplication::Translate('Zip');
			$this->txtZip->Text = $this->objUser->Zip;
			$this->txtZip->Required = true;
			$this->txtZip->MaxLength = User::ZipMaxLength;
			return $this->txtZip;
		}

		/**
		 * Create and setup QLabel lblZip
		 * @param string $strControlId optional ControlId to use
		 * @return QLabel
		 */
		public function lblZip_Create($strControlId = null) {
			$this->lblZip = new QLabel($this->objParentObject, $strControlId);
			$this->lblZip->Name = QApplication::Translate('Zip');
			$this->lblZip->Text = $this->objUser->Zip;
			$this->lblZip->Required = true;
			return $this->lblZip;
		}

		/**
		 * Create and setup QIntegerTextBox txtFbinCount
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtFbinCount_Create($strControlId = null) {
			$this->txtFbinCount = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtFbinCount->Name = QApplication::Translate('Fbin Count');
			$this->txtFbinCount->Text = $this->objUser->FbinCount;
			$this->txtFbinCount->Required = true;
			return $this->txtFbinCount;
		}

		/**
		 * Create and setup QLabel lblFbinCount
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblFbinCount_Create($strControlId = null, $strFormat = null) {
			$this->lblFbinCount = new QLabel($this->objParentObject, $strControlId);
			$this->lblFbinCount->Name = QApplication::Translate('Fbin Count');
			$this->lblFbinCount->Text = $this->objUser->FbinCount;
			$this->lblFbinCount->Required = true;
			$this->lblFbinCount->Format = $strFormat;
			return $this->lblFbinCount;
		}

		/**
		 * Create and setup QIntegerTextBox txtFbinTotal
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtFbinTotal_Create($strControlId = null) {
			$this->txtFbinTotal = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtFbinTotal->Name = QApplication::Translate('Fbin Total');
			$this->txtFbinTotal->Text = $this->objUser->FbinTotal;
			$this->txtFbinTotal->Required = true;
			return $this->txtFbinTotal;
		}

		/**
		 * Create and setup QLabel lblFbinTotal
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblFbinTotal_Create($strControlId = null, $strFormat = null) {
			$this->lblFbinTotal = new QLabel($this->objParentObject, $strControlId);
			$this->lblFbinTotal->Name = QApplication::Translate('Fbin Total');
			$this->lblFbinTotal->Text = $this->objUser->FbinTotal;
			$this->lblFbinTotal->Required = true;
			$this->lblFbinTotal->Format = $strFormat;
			return $this->lblFbinTotal;
		}

		/**
		 * Create and setup QIntegerTextBox txtFboutCount
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtFboutCount_Create($strControlId = null) {
			$this->txtFboutCount = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtFboutCount->Name = QApplication::Translate('Fbout Count');
			$this->txtFboutCount->Text = $this->objUser->FboutCount;
			$this->txtFboutCount->Required = true;
			return $this->txtFboutCount;
		}

		/**
		 * Create and setup QLabel lblFboutCount
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblFboutCount_Create($strControlId = null, $strFormat = null) {
			$this->lblFboutCount = new QLabel($this->objParentObject, $strControlId);
			$this->lblFboutCount->Name = QApplication::Translate('Fbout Count');
			$this->lblFboutCount->Text = $this->objUser->FboutCount;
			$this->lblFboutCount->Required = true;
			$this->lblFboutCount->Format = $strFormat;
			return $this->lblFboutCount;
		}

		/**
		 * Create and setup QIntegerTextBox txtFboutTotal
		 * @param string $strControlId optional ControlId to use
		 * @return QIntegerTextBox
		 */
		public function txtFboutTotal_Create($strControlId = null) {
			$this->txtFboutTotal = new QIntegerTextBox($this->objParentObject, $strControlId);
			$this->txtFboutTotal->Name = QApplication::Translate('Fbout Total');
			$this->txtFboutTotal->Text = $this->objUser->FboutTotal;
			$this->txtFboutTotal->Required = true;
			return $this->txtFboutTotal;
		}

		/**
		 * Create and setup QLabel lblFboutTotal
		 * @param string $strControlId optional ControlId to use
		 * @param string $strFormat optional sprintf format to use
		 * @return QLabel
		 */
		public function lblFboutTotal_Create($strControlId = null, $strFormat = null) {
			$this->lblFboutTotal = new QLabel($this->objParentObject, $strControlId);
			$this->lblFboutTotal->Name = QApplication::Translate('Fbout Total');
			$this->lblFboutTotal->Text = $this->objUser->FboutTotal;
			$this->lblFboutTotal->Required = true;
			$this->lblFboutTotal->Format = $strFormat;
			return $this->lblFboutTotal;
		}



		/**
		 * Refresh this MetaControl with Data from the local User object.
		 * @param boolean $blnReload reload User from the database
		 * @return void
		 */
		public function Refresh($blnReload = false) {
			if ($blnReload)
				$this->objUser->Reload();

			if ($this->lblId) if ($this->blnEditMode) $this->lblId->Text = $this->objUser->Id;

			if ($this->txtNick) $this->txtNick->Text = $this->objUser->Nick;
			if ($this->lblNick) $this->lblNick->Text = $this->objUser->Nick;

			if ($this->txtPassword) $this->txtPassword->Text = $this->objUser->Password;
			if ($this->lblPassword) $this->lblPassword->Text = $this->objUser->Password;

			if ($this->txtEmail) $this->txtEmail->Text = $this->objUser->Email;
			if ($this->lblEmail) $this->lblEmail->Text = $this->objUser->Email;

			if ($this->txtStatus) $this->txtStatus->Text = $this->objUser->Status;
			if ($this->lblStatus) $this->lblStatus->Text = $this->objUser->Status;

			if ($this->calCreatedAt) $this->calCreatedAt->DateTime = $this->objUser->CreatedAt;
			if ($this->lblCreatedAt) $this->lblCreatedAt->Text = sprintf($this->objUser->CreatedAt) ? $this->objUser->CreatedAt->__toString($this->strCreatedAtDateTimeFormat) : null;

			if ($this->txtActivationKey) $this->txtActivationKey->Text = $this->objUser->ActivationKey;
			if ($this->lblActivationKey) $this->lblActivationKey->Text = $this->objUser->ActivationKey;

			if ($this->calActivatedAt) $this->calActivatedAt->DateTime = $this->objUser->ActivatedAt;
			if ($this->lblActivatedAt) $this->lblActivatedAt->Text = sprintf($this->objUser->ActivatedAt) ? $this->objUser->ActivatedAt->__toString($this->strActivatedAtDateTimeFormat) : null;

			if ($this->calLastseenAt) $this->calLastseenAt->DateTime = $this->objUser->LastseenAt;
			if ($this->lblLastseenAt) $this->lblLastseenAt->Text = sprintf($this->objUser->LastseenAt) ? $this->objUser->LastseenAt->__toString($this->strLastseenAtDateTimeFormat) : null;

			if ($this->txtRealname) $this->txtRealname->Text = $this->objUser->Realname;
			if ($this->lblRealname) $this->lblRealname->Text = $this->objUser->Realname;

			if ($this->txtAddress) $this->txtAddress->Text = $this->objUser->Address;
			if ($this->lblAddress) $this->lblAddress->Text = $this->objUser->Address;

			if ($this->txtState) $this->txtState->Text = $this->objUser->State;
			if ($this->lblState) $this->lblState->Text = $this->objUser->State;

			if ($this->txtZip) $this->txtZip->Text = $this->objUser->Zip;
			if ($this->lblZip) $this->lblZip->Text = $this->objUser->Zip;

			if ($this->txtFbinCount) $this->txtFbinCount->Text = $this->objUser->FbinCount;
			if ($this->lblFbinCount) $this->lblFbinCount->Text = $this->objUser->FbinCount;

			if ($this->txtFbinTotal) $this->txtFbinTotal->Text = $this->objUser->FbinTotal;
			if ($this->lblFbinTotal) $this->lblFbinTotal->Text = $this->objUser->FbinTotal;

			if ($this->txtFboutCount) $this->txtFboutCount->Text = $this->objUser->FboutCount;
			if ($this->lblFboutCount) $this->lblFboutCount->Text = $this->objUser->FboutCount;

			if ($this->txtFboutTotal) $this->txtFboutTotal->Text = $this->objUser->FboutTotal;
			if ($this->lblFboutTotal) $this->lblFboutTotal->Text = $this->objUser->FboutTotal;

		}



		///////////////////////////////////////////////
		// PROTECTED UPDATE METHODS for ManyToManyReferences (if any)
		///////////////////////////////////////////////





		///////////////////////////////////////////////
		// PUBLIC USER OBJECT MANIPULATORS
		///////////////////////////////////////////////

		/**
		 * This will save this object's User instance,
		 * updating only the fields which have had a control created for it.
		 */
		public function SaveUser() {
			try {
				// Update any fields for controls that have been created
				if ($this->txtNick) $this->objUser->Nick = $this->txtNick->Text;
				if ($this->txtPassword) $this->objUser->Password = $this->txtPassword->Text;
				if ($this->txtEmail) $this->objUser->Email = $this->txtEmail->Text;
				if ($this->txtStatus) $this->objUser->Status = $this->txtStatus->Text;
				if ($this->calCreatedAt) $this->objUser->CreatedAt = $this->calCreatedAt->DateTime;
				if ($this->txtActivationKey) $this->objUser->ActivationKey = $this->txtActivationKey->Text;
				if ($this->calActivatedAt) $this->objUser->ActivatedAt = $this->calActivatedAt->DateTime;
				if ($this->calLastseenAt) $this->objUser->LastseenAt = $this->calLastseenAt->DateTime;
				if ($this->txtRealname) $this->objUser->Realname = $this->txtRealname->Text;
				if ($this->txtAddress) $this->objUser->Address = $this->txtAddress->Text;
				if ($this->txtState) $this->objUser->State = $this->txtState->Text;
				if ($this->txtZip) $this->objUser->Zip = $this->txtZip->Text;
				if ($this->txtFbinCount) $this->objUser->FbinCount = $this->txtFbinCount->Text;
				if ($this->txtFbinTotal) $this->objUser->FbinTotal = $this->txtFbinTotal->Text;
				if ($this->txtFboutCount) $this->objUser->FboutCount = $this->txtFboutCount->Text;
				if ($this->txtFboutTotal) $this->objUser->FboutTotal = $this->txtFboutTotal->Text;

				// Update any UniqueReverseReferences (if any) for controls that have been created for it

				// Save the User object
				$this->objUser->Save();

				// Finally, update any ManyToManyReferences (if any)
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}

		/**
		 * This will DELETE this object's User instance from the database.
		 * It will also unassociate itself from any ManyToManyReferences.
		 */
		public function DeleteUser() {
			$this->objUser->Delete();
		}		



		///////////////////////////////////////////////
		// PUBLIC GETTERS and SETTERS
		///////////////////////////////////////////////

		/**
		 * Override method to perform a property "Get"
		 * This will get the value of $strName
		 *
		 * @param string $strName Name of the property to get
		 * @return mixed
		 */
		public function __get($strName) {
			switch ($strName) {
				// General MetaControlVariables
				case 'User': return $this->objUser;
				case 'TitleVerb': return $this->strTitleVerb;
				case 'EditMode': return $this->blnEditMode;

				// Controls that point to User fields -- will be created dynamically if not yet created
				case 'IdControl':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'IdLabel':
					if (!$this->lblId) return $this->lblId_Create();
					return $this->lblId;
				case 'NickControl':
					if (!$this->txtNick) return $this->txtNick_Create();
					return $this->txtNick;
				case 'NickLabel':
					if (!$this->lblNick) return $this->lblNick_Create();
					return $this->lblNick;
				case 'PasswordControl':
					if (!$this->txtPassword) return $this->txtPassword_Create();
					return $this->txtPassword;
				case 'PasswordLabel':
					if (!$this->lblPassword) return $this->lblPassword_Create();
					return $this->lblPassword;
				case 'EmailControl':
					if (!$this->txtEmail) return $this->txtEmail_Create();
					return $this->txtEmail;
				case 'EmailLabel':
					if (!$this->lblEmail) return $this->lblEmail_Create();
					return $this->lblEmail;
				case 'StatusControl':
					if (!$this->txtStatus) return $this->txtStatus_Create();
					return $this->txtStatus;
				case 'StatusLabel':
					if (!$this->lblStatus) return $this->lblStatus_Create();
					return $this->lblStatus;
				case 'CreatedAtControl':
					if (!$this->calCreatedAt) return $this->calCreatedAt_Create();
					return $this->calCreatedAt;
				case 'CreatedAtLabel':
					if (!$this->lblCreatedAt) return $this->lblCreatedAt_Create();
					return $this->lblCreatedAt;
				case 'ActivationKeyControl':
					if (!$this->txtActivationKey) return $this->txtActivationKey_Create();
					return $this->txtActivationKey;
				case 'ActivationKeyLabel':
					if (!$this->lblActivationKey) return $this->lblActivationKey_Create();
					return $this->lblActivationKey;
				case 'ActivatedAtControl':
					if (!$this->calActivatedAt) return $this->calActivatedAt_Create();
					return $this->calActivatedAt;
				case 'ActivatedAtLabel':
					if (!$this->lblActivatedAt) return $this->lblActivatedAt_Create();
					return $this->lblActivatedAt;
				case 'LastseenAtControl':
					if (!$this->calLastseenAt) return $this->calLastseenAt_Create();
					return $this->calLastseenAt;
				case 'LastseenAtLabel':
					if (!$this->lblLastseenAt) return $this->lblLastseenAt_Create();
					return $this->lblLastseenAt;
				case 'RealnameControl':
					if (!$this->txtRealname) return $this->txtRealname_Create();
					return $this->txtRealname;
				case 'RealnameLabel':
					if (!$this->lblRealname) return $this->lblRealname_Create();
					return $this->lblRealname;
				case 'AddressControl':
					if (!$this->txtAddress) return $this->txtAddress_Create();
					return $this->txtAddress;
				case 'AddressLabel':
					if (!$this->lblAddress) return $this->lblAddress_Create();
					return $this->lblAddress;
				case 'StateControl':
					if (!$this->txtState) return $this->txtState_Create();
					return $this->txtState;
				case 'StateLabel':
					if (!$this->lblState) return $this->lblState_Create();
					return $this->lblState;
				case 'ZipControl':
					if (!$this->txtZip) return $this->txtZip_Create();
					return $this->txtZip;
				case 'ZipLabel':
					if (!$this->lblZip) return $this->lblZip_Create();
					return $this->lblZip;
				case 'FbinCountControl':
					if (!$this->txtFbinCount) return $this->txtFbinCount_Create();
					return $this->txtFbinCount;
				case 'FbinCountLabel':
					if (!$this->lblFbinCount) return $this->lblFbinCount_Create();
					return $this->lblFbinCount;
				case 'FbinTotalControl':
					if (!$this->txtFbinTotal) return $this->txtFbinTotal_Create();
					return $this->txtFbinTotal;
				case 'FbinTotalLabel':
					if (!$this->lblFbinTotal) return $this->lblFbinTotal_Create();
					return $this->lblFbinTotal;
				case 'FboutCountControl':
					if (!$this->txtFboutCount) return $this->txtFboutCount_Create();
					return $this->txtFboutCount;
				case 'FboutCountLabel':
					if (!$this->lblFboutCount) return $this->lblFboutCount_Create();
					return $this->lblFboutCount;
				case 'FboutTotalControl':
					if (!$this->txtFboutTotal) return $this->txtFboutTotal_Create();
					return $this->txtFboutTotal;
				case 'FboutTotalLabel':
					if (!$this->lblFboutTotal) return $this->lblFboutTotal_Create();
					return $this->lblFboutTotal;
				default:
					try {
						return parent::__get($strName);
					} catch (QCallerException $objExc) {
						$objExc->IncrementOffset();
						throw $objExc;
					}
			}
		}

		/**
		 * Override method to perform a property "Set"
		 * This will set the property $strName to be $mixValue
		 *
		 * @param string $strName Name of the property to set
		 * @param string $mixValue New value of the property
		 * @return mixed
		 */
		public function __set($strName, $mixValue) {
			try {
				switch ($strName) {
					// Controls that point to User fields
					case 'IdControl':
						return ($this->lblId = QType::Cast($mixValue, 'QControl'));
					case 'NickControl':
						return ($this->txtNick = QType::Cast($mixValue, 'QControl'));
					case 'PasswordControl':
						return ($this->txtPassword = QType::Cast($mixValue, 'QControl'));
					case 'EmailControl':
						return ($this->txtEmail = QType::Cast($mixValue, 'QControl'));
					case 'StatusControl':
						return ($this->txtStatus = QType::Cast($mixValue, 'QControl'));
					case 'CreatedAtControl':
						return ($this->calCreatedAt = QType::Cast($mixValue, 'QControl'));
					case 'ActivationKeyControl':
						return ($this->txtActivationKey = QType::Cast($mixValue, 'QControl'));
					case 'ActivatedAtControl':
						return ($this->calActivatedAt = QType::Cast($mixValue, 'QControl'));
					case 'LastseenAtControl':
						return ($this->calLastseenAt = QType::Cast($mixValue, 'QControl'));
					case 'RealnameControl':
						return ($this->txtRealname = QType::Cast($mixValue, 'QControl'));
					case 'AddressControl':
						return ($this->txtAddress = QType::Cast($mixValue, 'QControl'));
					case 'StateControl':
						return ($this->txtState = QType::Cast($mixValue, 'QControl'));
					case 'ZipControl':
						return ($this->txtZip = QType::Cast($mixValue, 'QControl'));
					case 'FbinCountControl':
						return ($this->txtFbinCount = QType::Cast($mixValue, 'QControl'));
					case 'FbinTotalControl':
						return ($this->txtFbinTotal = QType::Cast($mixValue, 'QControl'));
					case 'FboutCountControl':
						return ($this->txtFboutCount = QType::Cast($mixValue, 'QControl'));
					case 'FboutTotalControl':
						return ($this->txtFboutTotal = QType::Cast($mixValue, 'QControl'));
					default:
						return parent::__set($strName, $mixValue);
				}
			} catch (QCallerException $objExc) {
				$objExc->IncrementOffset();
				throw $objExc;
			}
		}
	}
?>